package edu.drexel.cs575.phw1;

import edu.drexel.cs575.phw1.scale.Button;
import edu.drexel.cs575.phw1.scale.DigitalScale;
import edu.drexel.cs575.phw1.scale.Power;
import edu.drexel.cs575.phw1.scale.WeighableItem;

/**
 * Simple driver program to demonstrate the use of a Scale.
 * 
 * @author anthony
 *
 */
public class Application {

	public static void main(String[] args) throws Exception {
		DigitalScale scale = new DigitalScale();
		Power power = new Power(120);
		
		//Turn on the scale. Default units for the scale is US
		scale.powerOn(power);
		
		//Add an item to the scale. mass is always in kg		
		scale.addItem(new WeighableItem(100));
		
		// zero out the scale
		scale.pushButton(Button.TARE);
		
		//add another item 
		scale.addItem(new WeighableItem(50));
		
		//turn off the beep
		scale.pushButton(Button.BEEP);
		
		//remove all items
		scale.removeItems();
		
		//change units (to metric)
		scale.pushButton(Button.TOGGLE_UNITS);
		
		//add another item 
		scale.addItem(new WeighableItem(50));
		
		//change units (to US)
		scale.pushButton(Button.TOGGLE_UNITS);
		
		//remove all items
		scale.removeItems();
		
		//turn off
		scale.powerOff();
	}

}
